import 'package:flutter/material.dart';
import 'package:online_study/theme/size.dart';
import 'package:online_study/video/video_page.dart';

//课程详情 头部(图片或者视频)
class CourseTopPage extends StatefulWidget {
  @override
  _CourseTopPageState createState() => _CourseTopPageState();
}

class _CourseTopPageState extends State<CourseTopPage> {
  String videoUrl = "111";

  @override
  Widget build(BuildContext context) {
    if (videoUrl == null || videoUrl.isEmpty) {
      return Container(
        width: double.infinity,
        height: ThemeSize.height160,
        child: Image.network(
            "https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg",
            fit: BoxFit.cover),
      );
    } else {
      return VideoPage(videoUrl);
    }
  }
}
